home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1995 April / Internet Tools.iso / infoserv / gopher / Unix / GopherTools / jughead / ISO-8859-1.NOTES.Z / ISO-8859-1.NOTES
Encoding:
Text File  |  1994-05-02  |  6.6 KB  |  216 lines

  1. These notes will help people wanting to use ISO 8859-1 stuff in
  2. WAIS.  We have only done this on Sun's running SunOS 4.1.3. To
  3. run it successfully under SunOS 4.1.1, one will need patches
  4. from Sun to correct problems with COLLDEF(8). 
  5.  
  6. 1- Install the collation table.
  7.  
  8. You might already have one, check /etc/locale/LC_COLLATE to see
  9. what's in it. You probably have only C and default in there.  
  10. Due to a bug in the SunOS 4.1.3, it is useless to have the thing 
  11. in /usr/share/lib/locale/LC_COLLATE since it's ignored. (This
  12. caused us much grief.)
  13.  
  14. We decided to use external definitions of the 8859-1 table 
  15. which we also put in /etc/locale/LC_COLLATE; we called this
  16. file iso_charmap but you can use anything as long as the same
  17. name appears in the input to COLLDEF(8).
  18.  
  19. As root, 
  20. /usr/etc/colldef <your_input_file /etc/locale/LC_COLLATE/iso_8859_1
  21. will install the table. Our copies of these files can be found at 
  22. the end of this document. By the way, my version of colldef gives
  23. a checksum of 02951  24.
  24.  
  25. One is not obliged to use the name iso_8859_1, but (for us at least)
  26. it tends to keep it simple since this is exactly what we are doing!
  27. If you do use something else, the lines containing
  28.     setlocale(LC_CTYPE,"iso_8859_1");
  29.     setlocale(LC_COLLATE,"iso_8859_1");
  30. will have to be changed to whatever is needed.
  31.  
  32.  
  33. 2- Recompile and reinstall WAIS.
  34.  
  35. This part is easy. Just add -DLOCALE to the CFLAGS line in the
  36. primary Makefile and make.  What this does is replace every call
  37. to STRCMP with a call to STRCOLL instead. It also adds calls to
  38. setlocale in the main programs.
  39.  
  40. The only other point worth mentionning: even if we stuck in
  41.     #include <locale.h>
  42.     setlocale(LC_CTYPE,"iso_8859_1");
  43.     setlocale(LC_COLLATE,"iso_8859_1");
  44. in the source, THIS DOES NOT SUFFICE! One must also have
  45.    LC_CTYPE=iso_8859_1
  46.    LC_COLLATE=iso_8859_1
  47. in the run-time environment. This also caused us much grief.
  48. This problem might be specific to Suns under 4.1.3
  49.  
  50. Note that Sun has put in the right stuff for LC_CTYPE which
  51. they have not done for LC_COLLATE.
  52.  
  53. One might also want to add to the stoplist. To more or less
  54. quote from the docs, when one generates an index, the
  55.    -stop stop_list_file_name
  56. option permits the use of another list.
  57. We've called our (French ISO 8859) stoplist stop.uqam and
  58. put it in here.
  59.  
  60. You might want to add the setlocale stuff to xwais if you're
  61. using it. In ~/x/xwais.c and ~/x/xwaisq.c, add
  62.     #include <locale.h>
  63.     setlocale(LC_CTYPE,"iso_8859_1");
  64.     setlocale(LC_COLLATE,"iso_8859_1");
  65.  
  66. 3- Gopher stuff.
  67.  
  68. If WAIS is called by Gopher, gopherd must be changed for all this
  69. to work. The same 3 lines must be added to ~/gopherd/gopherd.c, ie
  70.     #include <locale.h>
  71.     setlocale(LC_CTYPE,"iso_8859_1");
  72.     setlocale(LC_COLLATE,"iso_8859_1");
  73. and the run-time environment must contain
  74.    LC_CTYPE=iso_8859_1
  75.    LC_COLLATE=iso_8859_1
  76. for the same reasons as in WAIS.
  77.  
  78.  
  79. Good luck!
  80.  
  81. Sylvie St-Georges st-georges.sylvie@uqam.ca
  82.  
  83. Our iso_charmap file
  84. --------------------------------------------------
  85. A-grave        \xc0
  86. A-acute        \xc1
  87. A-circu        \xc2
  88. A-tilde        \xc3
  89. A-diaer        \xc4
  90. A-ring        \xc5
  91. AE        \xc6
  92. C-cedil        \xc7
  93. E-grave        \xc8
  94. E-acute        \xc9
  95. E-circu        \xca
  96. E-diaer        \xcb
  97. I-grave        \xcc
  98. I-acute        \xcd
  99. I-circu        \xce
  100. I-diaer        \xcf
  101. ETH        \xd0
  102. N-tilde        \xd1
  103. O-grave        \xd2
  104. O-acute        \xd3
  105. O-circu        \xd4
  106. O-tilde        \xd5
  107. O-diaer        \xd6
  108. MULT        \xd7
  109. O-stroke    \xd8
  110. U-grave        \xd9
  111. U-acute        \xda
  112. U-circu        \xdb
  113. U-diaer        \xdc
  114. Y-acute        \xdd
  115. THORN        \xde
  116. s-sharp        \xdf
  117. a-grave        \xe0
  118. a-acute        \xe1
  119. a-circu        \xe2
  120. a-tilde        \xe3
  121. a-diaer        \xe4
  122. a-ring        \xe5
  123. ae        \xe6
  124. c-cedil        \xe7
  125. e-grave        \xe8
  126. e-acute        \xe9
  127. e-circu        \xea
  128. e-diaer        \xeb
  129. i-grave        \xec
  130. i-acute        \xed
  131. i-circu        \xee
  132. i-diaer        \xef
  133. eth        \xf0
  134. n-tilde        \xf1
  135. o-grave        \xf2
  136. o-acute        \xf3
  137. o-circu        \xf4
  138. o-tilde        \xf5
  139. o-diaer        \xf6
  140. DIVIS        \xf7
  141. o-stroke    \xf8
  142. u-grave        \xf9
  143. u-acute        \xfa
  144. u-circu        \xfb
  145. u-diaer        \xfc
  146. y-acute        \xfd
  147. thorn        \xfe
  148. y-diaer        \xff
  149. --------------------------------------------------
  150.  
  151. Our input file to colldef
  152. --------------------------------------------------
  153.  
  154. charmap /etc/locale/LC_COLLATE/iso_charmap
  155.  
  156. substitute "\xc6" with "AE"
  157. substitute "\xdf" with "ss"
  158. substitute "\xe6" with "ae"
  159.  
  160. order \x00;...;\x20;\x21;\x22;\x23;\x24;\x25;\x26;\x27;\x28;\x29;\
  161.     \x2A;\x2B;\x2C;\x2D;\x2E;\x2F;0;1;2;3;4;5;6;7;8;9;\
  162.     \x3A;\x3B;\x3C;\x3D;\x3E;\x3F;\x40;\
  163.     \x5B;\x5C;\x5D;\x5E;\x5F;\x60;\x7B;\x7C;\x7D;\x7E;\x7F;\
  164.     (A,<A-grave>,<A-acute>,<A-circu>,<A-tilde>,<A-diaer>,<A-ring>,\
  165.      a,<a-grave>,<a-acute>,<a-circu>,<a-tilde>,<a-diaer>,<a-ring>);\
  166.     (B,b);(C,<C-cedil>,c,<c-cedil>);(D,d);\
  167.     (E,<E-grave>,<E-acute>,<E-circu>,<E-diaer>,\
  168.      e,<e-grave>,<e-acute>,<e-circu>,<e-diaer>);\
  169.     (F,f);(G,g);(H,h);\
  170.     (I,<I-grave>,<I-acute>,<I-circu>,<I-diaer>,\
  171.      i,<i-grave>,<i-acute>,<i-circu>,<i-diaer>);\
  172.     (J,j);(K,k);(L,l);(M,m);(N,<N-tilde>,n,<n-tilde>);\
  173.     (O,<O-grave>,<O-acute>,<O-circu>,<O-tilde>,<O-diaer>,<O-stroke>,\
  174.      o,<o-grave>,<o-acute>,<o-circu>,<o-tilde>,<o-diaer>,<o-stroke>);\
  175.     (P,p);(Q,q);(R,r);(S,s);(T,t);\
  176.     (U,<U-grave>,<U-acute>,<U-circu>,<U-diaer>,\
  177.      u,<u-grave>,<u-acute>,<u-circu>,<u-diaer>);\
  178.     (V,v);(W,w);(X,x);(Y,<Y-acute>,y,<y-acute>,<y-diaer>);(Z,z)
  179. --------------------------------------------------
  180.  
  181. --------------------------------------------------------------------------
  182. Jean-Pierre Kuypers <Kuypers@sri.ucl.ac.BE> writes the following:
  183.  
  184. About the credits, we'll not forget the works of Sylvie St-Georges
  185. (Bonjour, Sylvie) for a ISO 8859-1'able version of WAIS. Pascal Maes uses
  186. it to make his proposal. The work is available on ftp.uqam.ca:/pub/WAIS/,
  187. where the files alire (French) and README.iso8859 (English) explain what
  188. and how to do.
  189.  
  190. I try to install the new jughead version, on a SunOS 4.1.1. After some
  191. troubles, as usual, I have now a jughead server able to search non-ASCII
  192. items.
  193.  
  194. After uncommenting the CFLAG in the Makefile and making/installing, I must
  195. do a lot of things before it works.
  196.  
  197. - I run the "colldef" command with the two Sylvie's files. But I must
  198. delete all the "-", "<", and ">" is these files to avoid "Syntax error"
  199. messages with colldef.
  200.  
  201. - I must set the LC_COLLATE environment variable (I had already the
  202. LC_CTYPE) to iso_8859_1.
  203.  
  204. - I must do a link /etc/locale -> /usr/share/lib/locale. So, I don't put
  205. the stuff in /etc/locale/LC_COLLATE/ (as writed by Sylvie), but in
  206. /usr/share/lib/locale/LC_COLLATE/. 
  207.  
  208. - I must do "jughead -tB" to rebuild the correct index table. It's mandatory!
  209.  
  210. After that, I have a +/- good jughead server.
  211. Curiously, e' (e-acute) and e` (e-grave) are seen as t and l. So, re'seau
  212. and re`gles match as rtseau and rlgles. But they match correclty! To search
  213. "re'seau", I may give "re'seau" or "rtseau". With other letters, as a`, u`,
  214. e^, i^, o^, there is no problem. But E^ doesn't work.
  215.  
  216.